package source;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.Arrays;

/**
 * Collection Source 使用集合创建Source
 * 有限数据流
 */
public class CollectionSourceDemo {

    public static void main(String[] args) throws Exception {

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        DataStreamSource<Integer> data = env.fromCollection(Arrays.asList(1, 2, 3, 4, 5, 6));

        data.print();

        env.execute("collection source");
    }
}
